//
// Created by jsjxsy on 2022/8/19.
//operator type() const;
//
#include <iostream>
using namespace std;
struct A {
  A(int= 0);
  A(double);
  operator int() const;
  operator double() const;
};
void f2(long double arg);
void f3(int arg);
void f4(double arg);
int main() {
  A a;
  //f2(a);//二义性 1. f2(A::operator int()) 2. f2(A::operation double())
  f2(a.operator int());
  f2(a.operator double());
  f3(a);
  f4(a);
  long lg = 3;
  //A a2(lg);//二义性，不知道 1.A(int) 2.A(double)
  A a2((int) lg);
  A a3((double) lg);
  short s = 42;
  A a4(s);//short 类型提升 int

  return 0;
}

void f2(long double arg) {
  cout << "f2(arg=" << arg << endl;
}